<?php

/**
 * search actions.
 *
 * @package    BCWeb
 * @subpackage search
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class searchActions extends FilterActions {
    //executeIndex
    //    //$this->forward('default', 'module');
////    $value = $request->getPostParameter('pais_id');
//      $value1 = $request->getPostParameter('institucion[pais_id]');
//      if($request->isMethod('post')){
//          $this->logMessage("FFFFFFFFFFFFFFFFFFFFFFFFform valid POISSSSSSSSSSSSSSSSSTTTTTTTTT", "info");
//          
//          $this->valores = array();
//        $result = InstitutionTable::getInstance()->createQuery('i')
//            ->where('i.city_id = ? ')
//            ->execute($value1);
//
//        // the _ds_ref  parameter contains the select value wich it depends
//        // in this case will be the value for pais.id
//
//        foreach ($result as $item) {
//            $this->valores[$item->getId()] = $item->getName();
//        }
//
//        //return $valores;
//          $this->logMessage("-$value1- verssss",'info');
//      }else{
//        $this->logMessage("not is method post", "info");  
//      }

    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {
        $managerFiltro = new ManagerFiltro($this);
        $managerAviso = new ManagerAviso($this);
        $this->generateAd($request,$managerFiltro,$managerAviso);
    }

    /**
     * Executes universidades action
     *
     * @param sfRequest $request A request object
     */
    public function executeUniversidades(sfWebRequest $request) {
        $managerFiltro = new ManagerFiltroUniversidad($this);
        $managerAviso = new ManagerAvisoUniversidad($this);
        $this->generateAd($request,$managerFiltro,$managerAviso);
    }
    /**
     * Executes cursos action
     *
     * @param sfRequest $request A request object
     */
    public function executeCursos(sfWebRequest $request) {
        $managerFiltro = new ManagerFiltroCurso($this);
        $managerAviso = new ManagerAvisoCurso($this);
        $this->generateAd($request,$managerFiltro,$managerAviso);

    }

    private function generateAd(sfWebRequest $request,$managerFiltro,$managerAviso){
        $this->filtros = $managerFiltro->generar($request);
        $this->filtroEliminado = $managerFiltro->getEliminarfiltros();
        $this->filtroUbicacion = $managerFiltro->getFiltroUbicacion();
        $this->inputHiddenFiltro = $managerFiltro->getInputHiddenFiltro();
        $managerAviso->generar($request);
        $this->aviso = $managerAviso->getAviso();
        $this->pager = $managerAviso->getPager();
    }

    public function executeListAjaxLightView(sfWebRequest $request) {
        $managerAviso = new ManagerAviso($this);
        $managerAviso->generar($request);
        $this->aviso = $managerAviso->getAviso();
        $this->pager = $managerAviso->getPager();
    }

    public function executeDetalleInstitucion(sfWebRequest $request) {
        
    }
    public function executeDetalleCarrera(sfWebRequest $request) {
        
    }
    public function executeAjaxMoreDetails(sfWebRequest $request) {
        
    }

    public function executeIncreaseClicks(sfWebRequest $request) {
        
    }

    public function executePreview(sfWebRequest $request) {
        
    }

    public function executeDetalle(sfWebRequest $request) {
        
    }

    public function executeTest(sfWebRequest $request) {
        
    }
    public function executeTestItem(sfWebRequest $request) {
        
    }
    public function executeBanner(sfWebRequest $request) {
        
    }
    public function executeItem(sfWebRequest $request) {
        
    }
}
